 <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <th:block th:include="include :: header('行为标准')" />
    <link href="../static/css/workboard.css" th:href="@{/css/workboard.css}" rel="stylesheet"/>
</head>

<body>
    <div class="container-div">
        <div class="row">
            <div class="col-sm-12" style="background: #fff;border-radius: 6px;width: 100%;">
                <h3 style="text-align: center;padding-top: 15px;padding-bottom: 15px;border-bottom: 1px solid #ddd;" th:text="${title}+'信用评分标准'"></h3>
                <form id="behavioStandard-formId">
                    <div class="select-list" style="border-bottom: 1px solid #ddd;">
                        <ul>
                            <li>
                                                                                            关键字： <input name="keyword" type="text">
                            </li>
                            <li style="display:none">
                                <p style="width:98px">认定类型：</p>
                                <input type="text" name="identifyType" th:value="${title}"/>
                            </li>
                            <li style="display:none">
                                <p style="width:98px">行为类别：</p>
                                <input type="text" name="behaviorCategory" id="behavior"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search('behavioStandard-formId','behavioStandard')"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('behavioStandard-formId','behavioStandard')"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
                <ul class="nav_tabs">
                    <li class="tab-item" th:if="${strList!=null && strList.size()!=0}" th:each="str,stat : ${strList}">
                    	<span style="display:inline-block;width:100%;heigth:100%;" th:title="${str}==null ? ' ':${str}" th:data-id="${stat.count}" th:utext="${str}==null ? ' ':${str}"></span>
                    </li>
                </ul>
                <div class="tabsbody-item">
					<div class="col-sm-12 select-table table-striped">
						<table id="behavioStandard"></table>
					</div>
				</div>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
       var urlPrefix = ctx + [[${urlPrefix}]];
	   var title = [[${title}]];
	   var item = $('.nav_tabs').find('.tab-item').get(0);
	   item.classList.add('active');
	   var _attr = $('.nav_tabs').find('span').get(0).innerText;
	   behavioStandard(title,_attr);
	   var _flag = false;
	    
	    $('.nav_tabs').find('span').click(function () {
            $(this).parent().addClass('active').siblings().removeClass('active');
            var attr = $(this).text();
            $('#behavior').val(attr);
            
            _flag = true; 
            if(_flag){
            	$('#behavioStandard').bootstrapTable('destroy');
            	behavioStandard(title,attr);
            }
        })
        var behaviorCode = "";
        function behavioStandard(identifyType,punishObject){
            	var options = {
     			showSearch:false,
               	showRefresh:false,
               	showToggle:false,
               	showColumns:false,
               	id:'behavioStandard',		
               	url: urlPrefix + "/behavioStandardList/"+identifyType+"/"+punishObject,
               	modalName: "行为标准",
                columns: [
                {
                	field : 'select',
                	title : '选择',
                	radio:  true
                }, 	
                {
                    field : 'guid', 
                    title : '标识符',
					visible: false
                },
                {
                    field : 'behaviorCode', 
                    title : '行为代码'
                },
                {
                    field : 'behaviorCategory', 
                    title : '行为类别'
                },
                {
                    field : 'identifyType', 
                    title : '认定类型',
					visible: false
                },
                {
                    field : 'behavioDescription', 
                    title : '行为描述'
                },
                {
                    field : 'behaviorBasis', 
                    title : '数据来源',
					visible: false
                },
                {
                    field : 'legalProof', 
                    title : '法律依据',
					visible: false
                },
                {
                    field : 'punishObject', 
                    title : '行为认定对象'
                },
                {
                    field : 'penaltyScores', 
                    title : '记分分值'
                },
                {
                    field : 'valid', 
                    title : '有效期(月)'
                },
                {
                    field : 'maxScores', 
                    title : '最高分值',
					visible: false
                }
                ]
            }
            	$.table.init(options);
            	$('#behavioStandard').on('check.bs.table', function (e, arg1, arg2) {
            		behaviorCode = arg1.guid;
            	})
            }
        
        //确定回调 
        function submitHandler() {
        	var parent = window.parent;
			if($.common.isEmpty(behaviorCode)){
        		$.modal.msgError("请选择一条数据");
        		return;
        	}
        	parent.behavior(behaviorCode);
        	$.modal.close();
        }
    </script>
</body>

</html>